package com.primeton.eos.oss.model.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.io.IOException;
import java.time.LocalDateTime;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *  同步一体化平台的人员和机构信息
 * @author gxl_1
 *
 */
@Component
public class ThirdSynDataSchedule {

	private static final Logger logger = LoggerFactory.getLogger(ThirdSynDataSchedule.class);
	
	@Autowired
	ThirdSynDataService thirdSynDataService;
	
	@Scheduled(cron="${syn.schedule.cron}")
    public void cronSchedule() {
		try {
			thirdSynDataService.loadUser();
		} catch (IOException e) {
			logger.error("同步一体化平台数据异常!",e);
		}
        logger.info(">>>>>>>>Cron schedule:{}", LocalDateTime.now());
    }
}
